import request from '@/utils/request';

import { baseUrl } from '@/config/env';

export const loginByUsername = (grantType,tenantId, account, password, checkCode) => request({
  url: '/api/zdservercore-auth/token',
  method: 'post',
  params: {
	grantType,
    tenantId,
    account,
    password,
    checkCode
  }
})

export const getButtons = () => request({
	url: '/api/zdservercore-system/menu/buttons',
	method: 'get'
});

export const getUserInfo = () => request({
	url: baseUrl + '/user/getUserInfo',
	method: 'get'
});

export const refeshToken = () => request({
	url: baseUrl + '/user/refesh',
	method: 'post'
})

export const getMenu = () => request({
	url: '/api/zdservercore-system/menu/routes',
	method: 'get'
});

export const getTopMenu = () => request({
	url: baseUrl + '/user/getTopMenu',
	method: 'get'
});

export const sendLogs = (list) => request({
	url: baseUrl + '/user/logout',
	method: 'post',
	data: list
})

export const logout = () => request({
	url: baseUrl + '/user/logout',
	method: 'get'
})
